import subprocess
command1 = "net start mysql && mysql -u root -p"

try:
    # 启动MySQL服务
    subprocess.run(['powershell', '-Command', f'Start-Process cmd -ArgumentList"/c {command1}" -Verb RunAs'],
                   check=True)

except subprocess.CalledProcessError as e:
    print(f"An error occurred: {e}")
